<?php /* SVN: $Id: admin_add.ctp 2894 2010-09-02 10:01:36Z sakthivel_135at10 $ */ ?>
<div class="projects form">
<h2><?php echo $this->pageTitle;?></h2>
<?php echo $this->Form->create('Project', array('class' => 'normal clearfix','enctype' => 'multipart/form-data'));
?>
	<div class="admin-project-details">
		<fieldset>
			<legend><?php echo __l('Project details'); ?></legend>
			<?php
			echo $this->Form->input('name');
			echo $this->Form->input('short_description', array('type'=>'textarea','label'=>__l('Short description'),'info'=>__l('Entered description will display in home and listing pages')));
			echo $this->Form->input('description', array('type'=>'textarea', 'class' => 'js-editor', 'label'=>__l('Description'),'info'=>__l('Entered description will display in view page')));
			echo $this->Form->input('project_category_id', array('empty' => __l('Please select'),'label'=>__l('Project category')));
			echo $this->Form->input('user_id');
			?>
			<div class="upload-image required">
				<?php echo $this->Form->input('Attachment.filename', array('type' => 'file','size' => '33', 'label' => __l('Project image'),'info'=>__l('Maximum allowed size ').Configure::read('project.image.allowedSize').Configure::read('project.image.allowedSizeUnits'), 'class' =>'browse-field')); ?>
			</div>
			<?php
			echo $this->Form->input('video_embed_code',array('label'=>__l('Video embed code')));
			?>
		</fieldset>
	</div>
	<div class="admin-project-details">
		<fieldset>
			<legend><?php echo __l('Fund details'); ?></legend>
			<?php
				echo $this->Form->input('needed_amount', array('label'=>__l('Needed amount').' ('.Configure::read('site.currency').')'));
			?>
			<div class="input date admin-add">
				<div class="js-datetime">
					<?php echo $this->Form->input('project_funding_end_date', array('type' => 'date', 'div' => false,'label'=>__l('Project funding end date'), 'orderYear' => 'asc')); ?>
				</div>
				<span class="info"><?php echo __l('Ending date should be within ') .Configure::read('Project.paypal_expiry_date'). __l(' days from today. Because paypal authorization will expire in ').Configure::read('Project.paypal_expiry_date'). __l(' days'); ?></span>
			</div>
			<?php
			if (Configure::read('Project.is_allow_over_funding')) :
					echo $this->Form->input('is_allow_over_funding',array('label'=>__l('Allow 0verfunding')));
			endif
			?>
		</fieldset>
	</div>
	<?php if(Configure::read('Project.is_enable_project_rewards')): ?>
	<div class="admin-project-details">
			<fieldset>
				<legend><?php echo __l('Reward Details'); ?></legend>
				<?php
					if(Configure::read('Project.is_project_reward_optional')):
						$class = "not-required";
					endif;
				?>
				<div class="js-clone <?php echo $class; ?>">
					<div class="clearfix add-block"><span class ="js-add-more clone-add"><?php echo __l('Add More'); ?></span></div>
					<?php if(empty($this->request->data['ProjectReward'])):?>
						<div class="website-block js-field-list">
						<?php
								echo $this->Form->input('ProjectReward.0.pledge_amount',array('label'=>__l('Pledge amount').' ('.Configure::read('site.currency').')','info'=>__l('Reward amount')));
								echo $this->Form->input('ProjectReward.0.reward',array('info'=>__l('Reward details')));
								echo $this->Form->input('ProjectReward.0.pledge_max_user_limit',array('label'=>__l('Pledge max user limit'),'info'=>__l('Maximum user allowed for this reward. Leave blank for no limit.')));
						?>
						</div>
					<?php else:	?>
						<?php 	foreach($this->request->data['ProjectReward'] as $key => $projectReward) :?>
							<div class="phone-block website js-field-list">
							<?php if($key):?>
								<span class="js-website-remove clone-remove"><?php echo __l('Remove'); ?></span>
							<?php endif;?>
							<?php
								echo $this->Form->input('ProjectReward.'.$key.'.pledge_amount',array('label'=>__l('Pledge amount').' ('.Configure::read('site.currency').')','info'=>__l('Reward amount')));
								echo $this->Form->input('ProjectReward.'.$key.'.reward',array('info'=>__l('Reward details')));
								echo $this->Form->input('ProjectReward.'.$key.'.pledge_max_user_limit',array('label'=>__l('Pledge max user limit'),'info'=>__l('Maximum user allowed for this reward. Leave blank for no limit.')));
							?>
							</div>
						<?php endforeach;?>
					<?php endif;?>
				</div>
			</fieldset>
	</div>
	<?php endif; ?>
	<div class="admin-project-details">
		<fieldset>
			<legend><?php echo __l('Admin actions'); ?></legend>
			<?php
				echo $this->Form->input('project_status_id', array('empty' => __l('Please select'),'label'=>__l('Project status')));
				echo $this->Form->input('is_active',array('label'=>__l('Active')));
				echo $this->Form->input('is_recommended',array('label'=>__l('Recommended')));
			?>
		</fieldset>
	</div>

<?php echo $this->Form->end(__l('Add'));?>
</div>